import { _decorator, Component, EditBox, Node } from "cc";
import EventManager from "../manages/EventManager";
import { EventEnum } from "../Enum";
import { ConnectionManager } from "../manages/ConnectionManger";

const { ccclass, property } = _decorator;
@ccclass('IndexManager')
export class IndexManager extends Component {

    toHall: Node;
    createRoom: Node;
    loginBtn: Node;

    onLoad() {
        this.toHall = this.node.getChildByName("Hall")
        this.createRoom = this.node.getChildByName("Create")
        this.toHall.on(Node.EventType.MOUSE_DOWN, this.toHallHandle, this)
        this.createRoom.on(Node.EventType.MOUSE_DOWN, this.createRoomHandle, this)
    }

    toHallHandle() {
        console.log("toHallHandle");

    }
    createRoomHandle() {
        console.log("createRoomHandle");

    }
    onDestroy() {
        this.toHall.off(Node.EventType.TOUCH_START, this.toHallHandle, this)
        this.createRoom.off(Node.EventType.TOUCH_START, this.createRoomHandle, this)

    }




}

